Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable consumption into secretless-broker #533

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

orenbm
Copy link

@orenbm orenbm commented Oct 23, 2019

We are adding a plugin to the secretless-broker project (https://github.com/cyberark/secretless-broker) and will be using your project to communicate with SQL Server. Secretless is written in go too and needs a bit more access to some of the internals of this project. In this PR we expose the constants & functions we need to use. Other than that, the logic stays the same.

The Secretless Broker lets your applications connect securely to services - without ever having to fetch or manage passwords or keys. It does so by acting as a connector between the application and the target, retrieving the credentials for authentication from a credentials provider. This way, it opens an authenticated stream between the application and the target, so the application doesn't need to manage credentials in its code. To do so with mssql, we need to get the underlying channel and and the credentials to the message. We needed access to some constants and structs to do so.

It would be great if these minor changes will be merged to the go-mssqldb project so we can consume it as a 3rd party to our project, rather than relying on our own fork.

…ming the project

- Consts
  - Prelogin consts (PreloginVERSION, PreloginENCRYPTION, etc.)
  - Encrypt consts (EncryptOff, EncryptOn, etc.)
- Types
  - TdsBuffer
  - KeySlice
- Functions
  - NewTdsBuffer
  - ReadNextPacket
@codecov
Copy link

codecov bot commented Oct 23, 2019

Codecov Report

Merging #533 into master will decrease coverage by 0.02%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
- Coverage   68.86%   68.83%   -0.03%     
==========================================
  Files          22       22              
  Lines        5058     5060       +2     
==========================================
  Hits         3483     3483              
- Misses       1369     1371       +2     
  Partials      206      206
Impacted Files Coverage Δ
net.go 42.52% <ø> (ø) ⬆️
mssql.go 82.45% <0%> (-0.27%) ⬇️
tran.go 34.78% <100%> (ø) ⬆️
buf.go 100% <100%> (ø) ⬆️
types.go 77.29% <100%> (ø) ⬆️
rpc.go 36.84% <100%> (ø) ⬆️
tds.go 60.44% <91.66%> (ø) ⬆️
token.go 55.91% <91.66%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfbb681...77827dd. Read the comment docs.

@denisenkom
Copy link
Owner

I don't like exposing so much of internal structures as an interface. That would make it much harder to change internals without introducing a breaking change in the interface.
Is it possible to provide some minimal hooks to allow you to implement your functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants